package mmc.objects;

import static org.lwjgl.opengl.GL11.*;

import mmc.EngineObject;
import mmc.server.Server;

import org.lwjgl.opengl.GL11;

@SuppressWarnings("serial")
public class Cube extends EngineObject{

	public Cube(float x, float y, float z) {
		super(x, y, z);
	}

	@Override
	public void render(EngineObject observer) {
		glPushMatrix();
		
		glTranslatef(x,y,z);
		
		GL11.glBegin(GL11.GL_QUADS); // Start Drawing Quads
		// Front Face
		GL11.glNormal3f(0.0f, 0.0f, 1.0f); // Normal Pointing Towards Viewer
		GL11.glVertex3f(-1.0f, -1.0f, 1.0f); // Point 1 (Front)
		GL11.glVertex3f(1.0f, -1.0f, 1.0f); // Point 2 (Front)
		GL11.glVertex3f(1.0f, 1.0f, 1.0f); // Point 3 (Front)
		GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Point 4 (Front)
		// Back Face
		GL11.glNormal3f(0.0f, 0.0f, -1.0f); // Normal Pointing Away From Viewer
		GL11.glVertex3f(-1.0f, -1.0f, -1.0f); // Point 1 (Back)
		GL11.glVertex3f(-1.0f, 1.0f, -1.0f); // Point 2 (Back)
		GL11.glVertex3f(1.0f, 1.0f, -1.0f); // Point 3 (Back)
		GL11.glVertex3f(1.0f, -1.0f, -1.0f); // Point 4 (Back)
		// Top Face
		GL11.glNormal3f(0.0f, 1.0f, 0.0f); // Normal Pointing Up
		GL11.glVertex3f(-1.0f, 1.0f, -1.0f); // Point 1 (Top)
		GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Point 2 (Top)
		GL11.glVertex3f(1.0f, 1.0f, 1.0f); // Point 3 (Top)
		GL11.glVertex3f(1.0f, 1.0f, -1.0f); // Point 4 (Top)
		// Bottom Face
		GL11.glNormal3f(0.0f, -1.0f, 0.0f); // Normal Pointing Down
		GL11.glVertex3f(-1.0f, -1.0f, -1.0f); // Point 1 (Bottom)
		GL11.glVertex3f(1.0f, -1.0f, -1.0f); // Point 2 (Bottom)
		GL11.glVertex3f(1.0f, -1.0f, 1.0f); // Point 3 (Bottom)
		GL11.glVertex3f(-1.0f, -1.0f, 1.0f); // Point 4 (Bottom)
		// Right face
		GL11.glNormal3f(1.0f, 0.0f, 0.0f); // Normal Pointing Right
		GL11.glVertex3f(1.0f, -1.0f, -1.0f); // Point 1 (Right)
		GL11.glVertex3f(1.0f, 1.0f, -1.0f); // Point 2 (Right)
		GL11.glVertex3f(1.0f, 1.0f, 1.0f); // Point 3 (Right)
		GL11.glVertex3f(1.0f, -1.0f, 1.0f); // Point 4 (Right)
		// Left Face
		GL11.glNormal3f(-1.0f, 0.0f, 0.0f); // Normal Pointing Left
		GL11.glVertex3f(-1.0f, -1.0f, -1.0f); // Point 1 (Left)
		GL11.glVertex3f(-1.0f, -1.0f, 1.0f); // Point 2 (Left)
		GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Point 3 (Left)
		GL11.glVertex3f(-1.0f, 1.0f, -1.0f); // Point 4 (Left)
		GL11.glEnd(); // Done Drawing Quads
		glPopMatrix();
	}

	@Override
	public void update(float dt) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(Server server, float dt) {
		// TODO Auto-generated method stub
		
	}

}
